from xlrd import open_workbook
from xlutils.copy import copy

rb = open_workbook(r'D:\workspace\GoTest\file\宏学习.xlsm')

wb = copy(rb)
print(wb)

sheet_name = rb.sheet_names()
print(sheet_name)

sheet = rb.sheet_by_index(1)  #从0开始计数
print(sheet)
nrows = sheet.nrows       #sheet中的行数
ncols = sheet.ncols       #sheet中的列数
print(nrows)              #
print(ncols)              #

#修改内容
#ws = wb.get_sheet(0)
#ws.write(0,0,'changed!')

wb.save(r'D:\Excel_Workbook.xls')
